1. Field of the Invention
This invention relates generally to digital filters, and more particularly to a method of efficiently implementing digital filters on the fly without use of division and/or trigonometric functions.
2. Description of the Prior Art Digital filters are well known in the art. First and second order allpass digital filters are often used as building blocks to implement equalizers. Some types of equalizers have a fixed number of filters having fixed center frequencies and bandwidths and adjustable gains. Other types of equalizers can have a fixed number of filters wherein each filter has a fixed gain, bandwidth and center frequency. The type of equalizer used is dependent upon the particular application. Parametric equalizers, for example, require implementation of the filters solely necessary to eliminate or correct specific problems such as undesirable variations in frequency characteristics associated with certain loudspeakers.
FIG. 1 depicts a well known equalization filter comprising a second-order allpass filter A(z) and k is the peak gain of the equalization filter. The second-order allpass filter A(z) depicted in FIG. 1 further has the form illustrated in FIG. 2. Useful properties of the filter structures shown in FIGS. 1 and 2, such as the relationships that exist between particular parameters and coefficients, are also well known. Boost filters, for example, are known to exhibit the relationships between multiplier parameter xcex2 and the bandwidth xcexa9 shown in equation 1 and between a and the center frequency xcfx890 shown in equation 2 below when using such filter structures. Further, cut filters are known to exhibit the relationships between the xcex2 multiplier parameter, the bandwidth xcexa9 and the gain k shown in equation 3 below when using such filter structures.
xcex2=[tan(xcexa9/2)xe2x88x921]/[tan(xcexa9/2)+1]xe2x80x83xe2x80x83(1)
xcex1=xe2x88x92cos(xcfx890)xe2x80x83xe2x80x83(2)
xcex2=[tan(xcexa9/2)xe2x88x92k]/[tan(xcexa9/2)+k]xe2x80x83xe2x80x83(3)
McGrath, D. S., A New Approach to Digital Audio Equalization, 97th AES, November, 1994, discloses combining a graphical user interface to a long finite impulse response (FIR) filter equalizer to give some of the benefits of a parametric equalizer with the controllability of a graphic equalizer. McGrath also states that his approach can be accomplished via infinite impulse response (IIR) filters.
One class of digital filters associated with particular equalizers requires the ability to change the gain k in small increments. This requirement is especially problematic for cut filters since, as seen from equation (3) above, xcex2 has a dependency on the gain k. While this is not a problem in systems with both trigonometric functions and division capability, it can be complicated to deal with otherwise. Systems having division capability but no trigonometric capability can tabulate and download tangent function values as a filter parameter, since that particular filter parameter is seen to be a constant for each value of bandwidth. The xcex2 parameter that comprises the tangent function can then efficiently be calculated as necessary using the relationship of equation (4) below.
xcex2=[("PHgr"xe2x88x92k]/["PHgr"+k]xe2x80x83xe2x80x83(4)
Systems having neither division capability nor trigonometric capability often. require utilization of piecewise linearization techniques well known to one of ordinary skill in the art of mathematical modeling techniques, for example, assuming that the bandwidth and gains are known in advance or will be chosen from a small set of possible values. A special class of digital filters, however, requires the ability to compute equation (4) on the fly (in near real time). This special class of filters has neither division nor trigonometric capabilities, but must still be capable of varying the filter characteristics with more flexibility than that achievable when using the above referenced piecewise linearization techniques.
In view of the foregoing, it would be desirable to have a versatile and efficient method of varying digital filter multiplier element parameters or other element parameters that exhibit trigonometric and/or divisional relationships among certain filter input characteristics, including but not necessary limited to, bandwidth, sampling frequency and gain. Such a method of varying these digital filter parameters would allow implementation of a unique class of digital filters in which filtering qualities could be achieved in near real time, even when the aforesaid trigonometric and division capabilities are not available in either hardware or software to aid in the implementation process.
The present invention is directed to a method of efficiently varying digital parameters on the fly without use of division functions alone or in combination with trigonometric functions. Desired user inputs are passed through a translation function to convert filter characteristics such as center frequency, bandwidth and gain into filter parameters (xcex1, xcex2, k) via equations 1-3 presented above. A general purpose processor such as a DSP, microprocessor, or micro-controller could be coupled with switches, shaft encoders, or a keyboard to perform the foregoing input and translation functions. The present inventive method translates user inputs into filter parameters via a novel fast reciprocal estimate function shown in equation (5) for accurately forming an estimate for the reciprocal of a constant x.
1/x≈(1/s)*2xe2x88x92nxe2x88x922xe2x88x92r* 2xe2x88x922nxe2x88x921+2xe2x88x92nxe2x88x921; wherexe2x80x83xe2x80x83(5)
s is a scaling parameter that will ordinarily have a value between 0.5 and 0.6 and is a constant for each application. Therefore the inverse of s can be tabled and applied to avoid computation of its reciprocal. The value of n is represented by the MSD (most significant digit) of the number x, and r=xxe2x88x922n.
The present reciprocal estimate function can then be used to quickly, accurately and efficiently vary digital filter parameters such as the multiplier element xcex2 parameter for particular digital filters such as the allpass-based filters illustrated in FIGS. 1 and 2. Although a general purpose processor such as a DSP, microprocessor, or micro-controller could be coupled with switches, shaft encoders, or a keyboard to perform both the translation and filtering functions, the filtering function itself could just as well be provided via an audio processor such as a member of the TAS3xxx family of devices commercially available from Texas Instruments Incorporated having a place of business in Dallas, Tx.
As used herein, the following words have the following meanings. The words xe2x80x9calgorithmic softwarexe2x80x9d mean an algorithmic program used to direct the processing of data by a computer or data processing device. The words xe2x80x9cdata processing devicexe2x80x9d as used herein refer to a CPU, DSP, microprocessor, micro-controller, or other like device and an interface system. The interface system provides access to the data processing device such that data could be entered and processed by the data processing device. The words xe2x80x9cdiscrete dataxe2x80x9d as used herein are interchangeable with xe2x80x9cdigitized dataxe2x80x9d and xe2x80x9cdigitized dataxe2x80x9d as used herein means data which are stored in the form of singularly isolated, discontinuous data or digits.
Thus, one method of characterizing a digital filter on the fly according to one preferred embodiment will comprise:
providing a predetermined digital filter gain k;
providing a predetermined digital filter bandwidth;
providing a predetermined constant "PHgr", where "PHgr" is the tangent of half the bandwidth;
providing a predetermined constant [1/s] where s is selected in the range between about 0.5 to about 0.6;
generating a constant x=("PHgr"+k);
generating a constant n having a value determined by the most significant digit of the constant x;
generating a digital filter multiplier parameter xcex2=["PHgr"xe2x88x92k]*[1/x], using the functional relationship 1/x=(1/s)*22xe2x88x92nxe2x88x922xe2x88x92r*2xe2x88x922nxe2x88x921+22xe2x88x92nxe2x88x921; where r=xxe2x88x922n; and
implementing a digital allpass filter comprising a multiplier element characterized with the digital multiplier parameter xcex2.
In one aspect of the invention, a method of generating a digital filter multiplier parameter advances that state of the art associated with digital equalizers by utilizing a simple method for approximating [tan(x)xe2x88x92y]/[tan(x)+y] without using trigonometric or division functions, to realize a digital filter.
In still another aspect of the invention, filter parameters are generated on the fly using only addition and/or subtraction functions to characterize a digital filter having adjustable center frequencies and bandwidths.